<?php

namespace App\Library;

use Illuminate\Support\Facades\Cache;

class Lock
{
    /**
     * get
     * @param string $key
     * @param callable $callback
     * @param int $seconds
     * @return mixed
     */
    public static function get(string $key, callable $callback, int $seconds = 10): mixed
    {
        return Cache::lock($key, $seconds)->get($callback);
    }
}
